package sh.grapendaal.tsuushin.module.uno.engine.dto.helper;

import sh.grapendaal.tsuushin.module.uno.engine.domain.Statistics;
import sh.grapendaal.tsuushin.module.uno.engine.dto.StatisticsState;

public final class StatisticsStateHelper {

	private StatisticsStateHelper() {
		// Utility class
	}
	
	public static StatisticsState createFromStatistics(Statistics stats) {
		if (stats == null) {
			return null;
		}
		
		StatisticsState statisticsState = new StatisticsState();
		statisticsState.setNumCardsPlayed(stats.getNumCardsPlayed());
		statisticsState.setRoundsLost(stats.getRoundsLost());
		statisticsState.setRoundsPlayed(stats.getRoundsPlayed());
		statisticsState.setRoundsWon(stats.getRoundsWon());
		statisticsState.setTotalScored(stats.getTotalScored());
		statisticsState.setTotalTimePlayed(stats.getTotalTimePlayed());
		statisticsState.setTotalTurnTime(stats.getTotalTurnTime());
		statisticsState.setTotalTurns(stats.getTotalTurns());
		return statisticsState;
	}
}
